<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI应用设置 - 公文写作</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        body {
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        .settings-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        .settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding-bottom: 15px;
            border-bottom: 1px solid #e1e4e8;
        }

        .settings-title {
            display: flex;
            align-items: center;
        }

        .settings-icon {
            width: 50px;
            height: 50px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 15px;
            background-color: #e0f7fa;
        }

        .settings-icon i {
            font-size: 24px;
            color: #00acc1;
        }

        .settings-name h2 {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 5px;
        }

        .settings-name p {
            color: #666;
            font-size: 14px;
        }

        .settings-actions {
            display: flex;
            gap: 10px;
        }

        .btn {
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.3s ease;
        }

        .btn-outline {
            background-color: transparent;
            border-color: #d1d5da;
            color: #24292e;
        }

        .btn-outline:hover {
            background-color: #f6f8fa;
        }

        .btn-primary {
            background-color: #2188ff;
            color: white;
            border-color: #2188ff;
        }

        .btn-primary:hover {
            background-color: #0d7ae5;
            border-color: #0d7ae5;
        }

        .btn-danger {
            background-color: #dc3545;
            color: white;
            border-color: #dc3545;
        }

        .btn-danger:hover {
            background-color: #c82333;
            border-color: #bd2130;
        }

        .settings-tabs {
            display: flex;
            border-bottom: 1px solid #e1e4e8;
            margin-bottom: 20px;
        }

        .tab-item {
            padding: 12px 20px;
            cursor: pointer;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all 0.3s ease;
        }

        .tab-item.active {
            border-bottom-color: #2188ff;
            color: #2188ff;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .settings-card {
            background-color: white;
            border-radius: 10px;
            padding: 25px;
            margin-bottom: 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .card-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .card-title .btn {
            font-size: 13px;
            padding: 5px 10px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-row {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }

        .form-col {
            flex: 1;
        }

        .form-label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            font-size: 14px;
        }

        .form-control {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #d1d5da;
            border-radius: 6px;
            font-size: 14px;
            transition: border-color 0.3s;
        }

        .form-control:focus {
            border-color: #2188ff;
            outline: none;
            box-shadow: 0 0 0 3px rgba(33, 136, 255, 0.2);
        }

        .form-select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #d1d5da;
            border-radius: 6px;
            font-size: 14px;
            background-color: white;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            background-size: 12px;
        }

        .form-textarea {
            width: 100%;
            min-height: 100px;
            padding: 10px 12px;
            border: 1px solid #d1d5da;
            border-radius: 6px;
            font-size: 14px;
            resize: vertical;
        }

        .checkbox-group {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }

        .checkbox-label {
            display: flex;
            align-items: center;
            cursor: pointer;
            font-size: 14px;
        }

        .checkbox-input {
            margin-right: 8px;
        }

        .radio-group {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }

        .radio-label {
            display: flex;
            align-items: center;
            cursor: pointer;
            font-size: 14px;
        }

        .radio-input {
            margin-right: 8px;
        }

        .form-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e1e4e8;
        }

        .api-key-container {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
        }

        .api-key-value {
            flex: 1;
            padding: 8px 12px;
            background-color: #f6f8fa;
            border-radius: 6px;
            font-family: monospace;
            font-size: 14px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .copy-btn {
            padding: 8px 12px;
            background-color: #f6f8fa;
            border: 1px solid #d1d5da;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
        }

        .copy-btn:hover {
            background-color: #e1e4e8;
        }

        .permission-table {
            width: 100%;
            border-collapse: collapse;
        }

        .permission-table th,
        .permission-table td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #e1e4e8;
        }

        .permission-table th {
            font-weight: 600;
            color: #666;
            font-size: 14px;
        }

        .permission-table td {
            font-size: 14px;
        }

        .user-cell {
            display: flex;
            align-items: center;
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background-color: #e1e4e8;
            margin-right: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #666;
            font-size: 14px;
        }

        .status-badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
        }

        .status-badge.active {
            background-color: #d4edda;
            color: #155724;
        }

        .status-badge.inactive {
            background-color: #f8d7da;
            color: #721c24;
        }

        .action-btn {
            padding: 4px 8px;
            font-size: 12px;
            background-color: transparent;
            border: 1px solid #d1d5da;
            border-radius: 4px;
            cursor: pointer;
        }

        .action-btn:hover {
            background-color: #f6f8fa;
        }

        .add-permission {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }

        .add-permission-select {
            flex: 1;
        }

        .advanced-toggle {
            display: flex;
            align-items: center;
            gap: 5px;
            background: none;
            border: none;
            color: #2188ff;
            cursor: pointer;
            font-size: 14px;
            margin-bottom: 20px;
        }

        .advanced-options {
            margin-top: 20px;
            padding: 20px;
            background-color: #f8f9fa;
            border-radius: 6px;
            border-left: 3px solid #2188ff;
        }

        .danger-zone {
            border-left: 3px solid #dc3545;
        }

        .danger-zone .card-title {
            color: #dc3545;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            display: none;
        }

        .modal-content {
            background-color: white;
            border-radius: 10px;
            width: 500px;
            max-width: 90%;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-header {
            padding: 20px;
            border-bottom: 1px solid #e1e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-title {
            font-size: 18px;
            font-weight: 600;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666;
        }

        .modal-body {
            padding: 20px;
        }

        .modal-footer {
            padding: 15px 20px;
            border-top: 1px solid #e1e4e8;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }

        .icon-preview {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .icon-option {
            width: 50px;
            height: 50px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border: 2px solid transparent;
        }

        .icon-option.selected {
            border-color: #2188ff;
        }

        .icon-option i {
            font-size: 20px;
        }

        .color-preview {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .color-option {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            cursor: pointer;
            border: 2px solid transparent;
        }

        .color-option.selected {
            border-color: #2188ff;
        }

        .status-toggle {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }

        .status-toggle input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .status-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 24px;
        }

        .status-slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked + .status-slider {
            background-color: #28a745;
        }

        input:checked + .status-slider:before {
            transform: translateX(26px);
        }

        .status-text {
            margin-left: 10px;
            font-size: 14px;
        }

        .toggle-container {
            display: flex;
            align-items: center;
        }
    </style>
</head>
<body onload="init()">
<div class="settings-container">
    <div class="settings-header">
        <div class="settings-title">
            <div class="settings-icon">
                <i class="fas fa-file-contract"></i>
            </div>
            <div class="settings-name">
                <h2>公文写作</h2>
                <p>应用设置</p>
            </div>
        </div>
        <div class="settings-actions">
            <button class="btn btn-outline" id="backBtn">
                <i class="fas fa-arrow-left"></i> 返回
            </button>
            <button class="btn btn-primary" id="saveSettingsBtn">
                <i class="fas fa-save"></i> 保存设置
            </button>
        </div>
    </div>

    <div class="settings-tabs">
        <div class="tab-item active" data-tab="basic">基本设置</div>
        <div class="tab-item" data-tab="permission">权限管理</div>
        <div class="tab-item" data-tab="api">API设置</div>
        <div class="tab-item" data-tab="advanced">高级设置</div>
    </div>

    <!-- 基本设置 -->
    <div class="tab-content active" id="basic-tab">
        <div class="settings-card">
            <div class="card-title">应用信息</div>
            <div class="form-group">
                <label class="form-label">应用名称</label>
                <input type="text" class="form-control" value="公文写作" placeholder="请输入应用名称">
            </div>
            <div class="form-group">
                <label class="form-label">应用分类</label>
                <select class="form-control form-select">
                    <option value="document" selected>公文处理</option>
                    <option value="qa">智能问答</option>
                    <option value="data">数据分析</option>
                    <option value="text">文本生成</option>
                    <option value="other">其他</option>
                </select>
            </div>
            <div class="form-group">
                <label class="form-label">应用描述</label>
                <textarea class="form-control form-textarea" placeholder="简要描述应用的功能和用途">根据模板和关键词自动生成公文初稿，支持多种公文格式和规范检查。</textarea>
            </div>
            <div class="form-row">
                <div class="form-col">
                    <div class="form-group">
                        <label class="form-label">选择图标</label>
                        <div class="icon-preview">
                            <div class="icon-option selected" style="background-color: #e0f7fa;">
                                <i class="fas fa-file-contract" style="color: #00acc1;"></i>
                            </div>
                            <div class="icon-option" style="background-color: #e8f5e9;">
                                <i class="fas fa-file-alt" style="color: #388e3c;"></i>
                            </div>
                            <div class="icon-option" style="background-color: #fff8e1;">
                                <i class="fas fa-file-signature" style="color: #ffa000;"></i>
                            </div>
                            <div class="icon-option" style="background-color: #f3e5f5;">
                                <i class="fas fa-file-word" style="color: #8e24aa;"></i>
                            </div>
                            <div class="icon-option" style="background-color: #e3f2fd;">
                                <i class="fas fa-file-pdf" style="color: #1976d2;"></i>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-col">
                    <div class="form-group">
                        <label class="form-label">图标颜色</label>
                        <div class="color-preview">
                            <div class="color-option selected" style="background-color: #00acc1;"></div>
                            <div class="color-option" style="background-color: #388e3c;"></div>
                            <div class="color-option" style="background-color: #ffa000;"></div>
                            <div class="color-option" style="background-color: #8e24aa;"></div>
                            <div class="color-option" style="background-color: #1976d2;"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">应用状态</label>
                <div class="toggle-container">
                    <label class="status-toggle">
                        <input type="checkbox" checked>
                        <span class="status-slider"></span>
                    </label>
                    <span class="status-text">已启用</span>
                </div>
            </div>
        </div>

        <div class="settings-card">
            <div class="card-title">访问控制</div>
            <div class="form-group">
                <label class="form-label">访问权限</label>
                <div class="radio-group">
                    <label class="radio-label">
                        <input type="radio" name="access" class="radio-input" checked>
                        部门内可见
                    </label>
                    <label class="radio-label">
                        <input type="radio" name="access" class="radio-input">
                        全单位可见
                    </label>
                    <label class="radio-label">
                        <input type="radio" name="access" class="radio-input">
                        指定人员可见
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">使用权限</label>
                <div class="checkbox-group">
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input" checked>
                        需要审批
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input">
                        记录使用日志
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input">
                        限制调用频率
                    </label>
                </div>
            </div>
        </div>
    </div>

    <!-- 权限管理 -->
    <div class="tab-content" id="permission-tab">
        <div class="settings-card">
            <div class="card-title">用户权限
                <button class="btn btn-outline btn-sm" id="addPermissionBtn">
                    <i class="fas fa-plus"></i> 添加权限
                </button>
            </div>
            <table class="permission-table">
                <thead>
                <tr>
                    <th>用户</th>
                    <th>部门</th>
                    <th>权限</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>
                        <div class="user-cell">
                            <div class="user-avatar">张</div>
                            <div>张三</div>
                        </div>
                    </td>
                    <td>办公室</td>
                    <td>管理员</td>
                    <td><span class="status-badge active">已启用</span></td>
                    <td>
                        <button class="action-btn">编辑</button>
                        <button class="action-btn">禁用</button>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="user-cell">
                            <div class="user-avatar">李</div>
                            <div>李四</div>
                        </div>
                    </td>
                    <td>秘书处</td>
                    <td>编辑者</td>
                    <td><span class="status-badge active">已启用</span></td>
                    <td>
                        <button class="action-btn">编辑</button>
                        <button class="action-btn">禁用</button>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="user-cell">
                            <div class="user-avatar">王</div>
                            <div>王五</div>
                        </div>
                    </td>
                    <td>法规处</td>
                    <td>使用者</td>
                    <td><span class="status-badge active">已启用</span></td>
                    <td>
                        <button class="action-btn">编辑</button>
                        <button class="action-btn">禁用</button>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="user-cell">
                            <div class="user-avatar">赵</div>
                            <div>赵六</div>
                        </div>
                    </td>
                    <td>信息中心</td>
                    <td>使用者</td>
                    <td><span class="status-badge inactive">已禁用</span></td>
                    <td>
                        <button class="action-btn">编辑</button>
                        <button class="action-btn">启用</button>
                    </td>
                </tr>
                </tbody>
            </table>

            <div class="add-permission" id="addPermissionForm" style="display: none;">
                <div class="add-permission-select">
                    <select class="form-control form-select">
                        <option value="">选择用户或部门...</option>
                        <option value="user1">张三 (办公室)</option>
                        <option value="user2">李四 (秘书处)</option>
                        <option value="user3">王五 (法规处)</option>
                        <option value="dept1">办公室</option>
                        <option value="dept2">秘书处</option>
                    </select>
                </div>
                <select class="form-control form-select" style="width: 150px;">
                    <option value="admin">管理员</option>
                    <option value="editor">编辑者</option>
                    <option value="user" selected>使用者</option>
                </select>
                <button class="btn btn-primary btn-sm">添加</button>
                <button class="btn btn-outline btn-sm" id="cancelAddPermission">取消</button>
            </div>
        </div>

        <div class="settings-card">
            <div class="card-title">角色权限</div>
            <div class="form-group">
                <label class="form-label">管理员权限</label>
                <div class="checkbox-group">
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input" checked>
                        修改应用设置
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input" checked>
                        管理用户权限
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input" checked>
                        查看使用统计
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input" checked>
                        导出数据
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">编辑者权限</label>
                <div class="checkbox-group">
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input" checked>
                        修改模板
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input" checked>
                        管理公文库
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input">
                        查看使用统计
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input">
                        导出数据
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">使用者权限</label>
                <div class="checkbox-group">
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input" checked>
                        使用应用功能
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input">
                        保存个人模板
                    </label>
                    <label class="checkbox-label">
                        <input type="checkbox" class="checkbox-input">
                        查看个人统计
                    </label>
                </div>
            </div>
        </div>
    </div>

    <!-- API设置 -->
    <div class="tab-content" id="api-tab">
        <div class="settings-card">
            <div class="card-title">API接入</div>
            <div class="form-group">
                <label class="form-label">API端点URL</label>
                <input type="text" class="form-control" value="https://api.example.com/v1/document/generate" placeholder="请输入API端点URL">
            </div>
            <div class="form-group">
                <label class="form-label">API接入方式</label>
                <div class="radio-group">
                    <label class="radio-label">
                        <input type="radio" name="apiType" class="radio-input" checked>
                        REST API
                    </label>
                    <label class="radio-label">
                        <input type="radio" name="apiType" class="radio-input">
                        WebSocket
                    </label>
                    <label class="radio-label">
                        <input type="radio" name="apiType" class="radio-input">
                        SDK集成
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">认证方式</label>
                <select class="form-control form-select">
                    <option value="apiKey" selected>API Key</option>
                    <option value="oauth">OAuth 2.0</option>
                    <option value="jwt">JWT</option>
                    <option value="none">无认证</option>
                </select>
            </div>
            <div class="form-group">
                <label class="form-label">API Key</label>
                <div class="api-key-container">
                    <div class="api-key-value">sk_test_51Hx8F2KZ3Q4r9g5f7d8e9f0a1b2c3d4e5f6g7h8</div>
                    <button class="copy-btn" id="copyApiKeyBtn">
                        <i class="fas fa-copy"></i> 复制
                    </button>
                    <button class="copy-btn" id="regenerateApiKeyBtn">
                        <i class="fas fa-sync-alt"></i> 重新生成
                    </button>
                </div>
            </div>
        </div>

        <div class="settings-card">
            <div class="card-title">API限制</div>
            <div class="form-row">
                <div class="form-col">
                    <div class="form-group">
                        <label class="form-label">请求频率限制</label>
                        <input type="number" class="form-control" value="100" placeholder="例如: 100">
                        <small class="form-text">请求次数/分钟</small>
                    </div>
                </div>
                <div class="form-col">
                    <div class="form-group">
                        <label class="form-label">每日上限</label>
                        <input type="number" class="form-control" value="1000" placeholder="例如: 1000">
                        <small class="form-text">请求次数/天</small>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">请求超时</label>
                <input type="number" class="form-control" value="10" placeholder="例如: 10">
                <small class="form-text">秒</small>
            </div>
            <div class="form-group">
                <label class="form-label">请求参数</label>
                <textarea class="form-control form-textarea" placeholder="请输入请求参数">{
  "template_id": "required|string",
  "keywords": "required|array",
  "format": "optional|string|values:docx,pdf,txt"
}</textarea>
            </div>
        </div>
    </div>

    <!-- 高级设置 -->
    <div class="tab-content" id="advanced-tab">
        <div class="settings-card">
            <div class="card-title">日志设置</div>
            <div class="form-group">
                <label class="form-label">日志级别</label>
                <select class="form-control form-select">
                    <option value="debug">Debug</option>
                    <option value="info" selected>Info</option>
                    <option value="warning">Warning</option>
                    <option value="error">Error</option>
                </select>
            </div>
            <div class="form-group">
                <label class="form-label">日志保留时间</label>
                <select class="form-control form-select">
                    <option value="7">7天</option>
                    <option value="30" selected>30天</option>
                    <option value="90">90天</option>
                    <option value="180">180天</option>
                    <option value="365">365天</option>
                </select>
            </div>
            <div class="form-group">
                <label class="form-label">日志存储位置</label>
                <input type="text" class="form-control" value="/var/log/ai-apps/document-writer" placeholder="请输入日志存储路径">
            </div>
        </div>

        <div class="settings-card">
            <div class="card-title">缓存设置</div>
            <div class="form-group">
                <label class="form-label">缓存启用</label>
                <div class="toggle-container">
                    <label class="status-toggle">
                        <input type="checkbox" checked>
                        <span class="status-slider"></span>
                    </label>
                    <span class="status-text">已启用</span>
                </div>
            </div>
            <div class="form-row">
                <div class="form-col">
                    <div class="form-group">
                        <label class="form-label">缓存时间</label>
                        <input type="number" class="form-control" value="3600" placeholder="例如: 3600">
                        <small class="form-text">秒</small>
                    </div>
                </div>
                <div class="form-col">
                    <div class="form-group">
                        <label class="form-label">缓存大小</label>
                        <input type="number" class="form-control" value="100" placeholder="例如: 100">
                        <small class="form-text">MB</small>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">缓存策略</label>
                <select class="form-control form-select">
                    <option value="lru" selected>LRU (最近最少使用)</option>
                    <option value="fifo">FIFO (先进先出)</option>
                    <option value="lfu">LFU (最不经常使用)</option>
                </select>
            </div>
        </div>

        <div class="settings-card danger-zone">
            <div class="card-title">危险区域</div>
            <div class="form-group">
                <label class="form-label">重置应用设置</label>
                <p style="margin-bottom: 10px;">这将重置所有应用设置为默认值，但不会删除任何数据。</p>
                <button class="btn btn-outline" id="resetSettingsBtn">
                    <i class="fas fa-undo"></i> 重置设置
                </button>
            </div>
            <div class="form-group">
                <label class="form-label">删除应用</label>
                <p style="margin-bottom: 10px;">这将永久删除此应用及其所有数据，此操作不可撤销。</p>
                <button class="btn btn-danger" id="deleteAppBtn">
                    <i class="fas fa-trash"></i> 删除应用
                </button>
            </div>
        </div>
    </div>

    <div class="settings-card">
        <div class="form-footer">
            <button class="btn btn-outline" id="cancelBtn">取消</button>
            <button class="btn btn-primary" id="saveBtn">
                <i class="fas fa-save"></i> 保存所有设置
            </button>
        </div>
    </div>
</div>

<!-- 重置设置确认模态框 -->
<div class="modal-overlay" id="resetModal">
    <div class="modal-content">
        <div class="modal-header">
            <div class="modal-title">确认重置设置</div>
            <button class="modal-close" id="closeResetModal">&times;</button>
        </div>
        <div class="modal-body">
            <p>您确定要重置此应用的所有设置吗？这将恢复所有设置为默认值。</p>
            <p><strong>注意：</strong>此操作不会删除任何应用数据。</p>
        </div>
        <div class="modal-footer">
            <button class="btn btn-outline" id="cancelResetBtn">取消</button>
            <button class="btn btn-primary" id="confirmResetBtn">确认重置</button>
        </div>
    </div>
</div>

<!-- 删除应用确认模态框 -->
<div class="modal-overlay" id="deleteModal">
    <div class="modal-content">
        <div class="modal-header">
            <div class="modal-title">确认删除应用</div>
            <button class="modal-close" id="closeDeleteModal">&times;</button>
        </div>
        <div class="modal-body">
            <p>您确定要永久删除此应用吗？此操作将删除：</p>
            <ul style="margin: 10px 0 10px 20px;">
                <li>所有应用设置</li>
                <li>所有使用记录</li>
                <li>所有生成的数据</li>
            </ul>
            <p><strong>警告：</strong>此操作不可撤销！</p>
            <div class="form-group" style="margin-top: 15px;">
                <label class="form-label">请输入应用名称以确认删除：</label>
                <input type="text" class="form-control" id="confirmDeleteInput" placeholder="请输入"公文写作"">
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-outline" id="cancelDeleteBtn">取消</button>
            <button class="btn btn-danger" id="confirmDeleteBtn" disabled>确认删除</button>
        </div>
    </div>
</div>

<script>

</script>
</body>
</html>